
<?php





class Place
{
	public $place_id;
	public $name;
	public $lat;
	public $lon;
	public $rate;
	public $state;
	public $user_description;
	//public $comments_list; //(array of comments)
	//public $comments_list; //(array of comments)
	private $conexion;
	
	protected $db;
	
    public function __construct($db)
    {
        $this->db = $db;
    }
	
	public function insert()	
    {
    	$data = array("name"=>$this->name,
                      "lat"=> $this->latitude,
                      "lon"=>$this->long);
    	
        $result = $this->db->insert("place",$data);
        
        return($result);
    }
	public function delete()	
    {
    	//primero borrarlo de TRIP-PLACE
    	//then erase in place
        
    }
	public function update()	
    {
    	
        //update directly in place
    }
    
	public function fecthComments($trip_id)	
    {
    	//$sql = "SELECT * FROM trip as t where t.user_id=".$user_id;
        //return($sql);
    }
	public function fecthPhotos($trip_id)	
    {
    	//$sql = "SELECT * FROM trip as t where t.user_id=".$user_id;
        //return($sql);
    }
 
}